n=int(input())
l=[]
z=0
c=1
b=3
for i in range(n):
a=list(map(int,input().split()))
if (c not in a) and (b not in a):
z+=1
l.append(i+1)
print(z)
print(*(i for i in l))
//#include<brain>
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll n,m,k,cnt;
struct node
{
bool b=1;
};
void anomalous_solve()
{
cin>>n;
ll a[n+1][n+1];
node b[n+1];
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
cin>>a[i][j];
if(a[i][j]==1)
{
b[i].b=0;
}
if(a[i][j]==2)
{
b[j].b=0;
}
if(a[i][j]==3)
{
b[i].b=0;
b[j].b=0;
}
}
}
vector<ll>ans;
for(int i=1;i<=n;i++)
{
if(b[i].b)
{
ans.push_back(i);
}
}
cout<<ans.size()<<"\n";
for(auto it:ans){
cout<<it<<" ";
}
}
int main()
{
// freopen("INPUT.txt","r",stdin);
// freopen("OUTPUT.txt","w",stdout);
ios_base::sync_with_stdio();
cin.tie(NULL);
cout.tie(NULL);
ll test=1;
//cin>>test;
for(int pos=1;pos<=test;pos++)
anomalous_solve();
}
71. Simplify Path | 62. Unique Paths |
50. Pow(x, n) | 43. Multiply Strings |
34. Find First and Last Position of Element in Sorted Array | 33. Search in Rotated Sorted Array |
17. Letter Combinations of a Phone Number | 5. Longest Palindromic Substring |
3. Longest Substring Without Repeating Characters | 1312. Minimum Insertion Steps to Make a String Palindrome |
1092. Shortest Common Supersequence | 1044. Longest Duplicate Substring |
1032. Stream of Characters | 987. Vertical Order Traversal of a Binary Tree |
952. Largest Component Size by Common Factor | 212. Word Search II |
174. Dungeon Game | 127. Word Ladder |
123. Best Time to Buy and Sell Stock III | 85. Maximal Rectangle |
84. Largest Rectangle in Histogram | 60. Permutation Sequence |
42. Trapping Rain Water | 32. Longest Valid Parentheses |
Cutting a material | Bubble Sort |
Number of triangles | AND path in a binary tree |
Factorial equations | Removal of vertices |